﻿using System.Drawing;
using PriceLibrary.ChartService;

namespace PriceLibrary.Utilities
{
    public class ColorHelper
    {
        public static Color FloorColor
        {
            get { return Color.FromArgb(00, 255, 255); }
        }

        public static Color DownColor
        {
            get { return Color.FromArgb(255, 000, 000); }
        }

        public static Color NoChangeColor
        {
            get { return Color.FromArgb(255, 255, 000); }
        }

        public static Color UpColor
        {
            get { return Color.FromArgb(00, 255, 00); }
        }

        public static Color CeilingColor
        {
            get { return Color.FromArgb(255, 0, 255); }
        }
        public static Color GetColor(StockInfoStatic infoStatic,double currentPrice)
        {
            if (currentPrice==infoStatic.Ceiling)
            {
                return CeilingColor;
            }
            if (currentPrice==infoStatic.Floor)
            {
                return FloorColor;
            }
            if (currentPrice==infoStatic.BasicPrice)
            {
                return NoChangeColor;
            }
            if (currentPrice <infoStatic.BasicPrice)
            {
                return DownColor;
            }
            if (currentPrice>infoStatic.BasicPrice)
            {
                return Color.Blue;
            }
            return NoChangeColor;
        }

        public static Color GetColor(double openPrice, double  closePrice)
        {
            if (openPrice >closePrice)
            {
                return DownColor;
            }
            if (openPrice <closePrice)
            {
                return Color.Lime;
            }
            return Color.Lime;
        }
    }
}
